package com.wk.code.wkserver.controller.common;

import com.wk.code.wkserver.response.result.R;
import com.wk.code.wkserver.service.IMailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wq
 * @version 1.0
 * @date 2021/02/25 13:39
 */
@RestController
@AllArgsConstructor
@Api(tags = "common-邮件管理")
public class MailController {

    private final IMailService mailService;

    /**
     * 发送简单邮件
     *
     * @param qqEmail qq邮箱
     * @param content 内容
     */
    @ApiOperation(value = "发送邮件", notes = "发送邮件")
    @GetMapping("/sendMail")
    public R<String> sendMail(String qqEmail, String content) {
        mailService.sendMail(qqEmail, content);
        return R.success("发送成功");
    }
}
